{{extends file="admin/admin_header.tpl"}}
{{block name="content"}}
<h3>添加新栏目
<div class="pull-right">
	<a href="{{site_url('category/index')}}" class="btn btn-sm btn-default">« 返回栏目列表</a>
</div>
</h3>
<ul class="nav nav-tabs">
	<li class="active">
		<a href="#tab-general" style="background-color: #f8f8f8 !important;">栏目信息</a>
	</li>
</ul>
<form action="{{site_url('category/store')}}" method="post" class="form-horizontal" autocomplete="off" style="background:#f8f8f8;padding:1em;border:1px solid #ddd;border-top:0;">
	<div class="tab-content">
	<input type="hidden" name="Method" value="{{$Method|h}}">
	<input type="hidden" name="Id" value="{{$category.0.Id}}">
		<div class="tab-pane active" id="tab-general" style="margin: 0 20px;">
			<div class="form-group">
				<label for="name">上级栏目</label>
				<select name="Pid" class="form-control">
					<option value="0" {{if $category[0]['Pid']==0}}selected="selected"{{/if}}>顶级栏目</option>
					{{foreach $lastcate as $v}}
					<option value="{{$v.Id|h}}" {{if $v.Id==$category[0]['Pid']}}selected="selected"{{/if}}>{{$v.CateName}}</option>
					{{/foreach}}
				</select>
			</div>
			<div class="form-group">
				<label for="name">栏目名称</label>
				<input type="text" name="CateName"  class="form-control" value="{{$category.0.CateName}}">
			</div>
			<div class="form-group">
				<label for="name">栏目类型</label>
				<select name="Type" class="form-control">
					<option value="目录" {{IsSelected('目录',$v.Type)}}>目录</option>
					<option value="文章列表" {{IsSelected('文章列表',$category.0.Type)}}>文章列表</option>
					<option value="教师列表" {{IsSelected('教师列表',$category.0.Type)}}>教师列表</option>
					<option value="下载列表" {{IsSelected('下载列表',$category.0.Type)}}>下载列表</option>
					<option value="链接列表" {{IsSelected('链接列表',$category.0.Type)}}>链接列表</option>
					<option value="单页面" {{IsSelected('单页面',$category.0.Type)}}>单页面</option>
				</select>
			</div>
			<div class="form-group">
				<label for="name">栏目排序</label>
				<input type="text" name="Sort" class="form-control" value="{{$category.0.Sort}}"/>
			</div>
		</div>
	</div>
	<div class="control-group">
		<div class="controls">
			<button type="reset" class="btn btn-default">清空</button>
			<button type="submit" class="btn btn-success">提交</button>
		</div>
	</div>
</form>
{{/block}}
